package com.perfma.xtest.byd;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;

import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author: junhui.si
 * @date: 2024-07-29 14:44
 **/
public class Index {

    private static String requestIpMap = "{\"ip2\":[\"3.3.3.3\"],\"ip1\":[\"1.1.1.1\",\"2.2.2.2\"]}";

    public static void main(String[] args) {
//        String name = "jdk7_web_1_tran_2.HTTP请求2";
//        System.out.println(name.substring(name.indexOf(".")));
        System.out.println(parseRequestIpMap());
    }

    public static Map<String, List<String>> parseRequestIpMap() {
        Map<String, List<String>> result = Maps.newHashMap();
        if (requestIpMap == null) {
            return result;
        }

        result = JSON.parseObject(requestIpMap, Map.class);
        result.replaceAll((k, v) -> JSON.parseArray(JSON.toJSONString(v), String.class));

        return result;
    }
}
